home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 001-025 / disk_023 / ver30 / sys / msdos / putline.s < prev    next >
Text File  |  1992-05-06  |  1KB  |  74 lines

  1. / High speed screen update for Rainbow.
  2. / MWC-86 has this in CP/M-86 but not in MS-DOS.
  3. / putline(row, col, buf);
  4. / Row and column are origin 1.
  5. / The buf is a pointer to an array of characters.
  6. / It won't write past the end of the line in
  7. / the video RAM; it looks for the FF at the end
  8. / of the line.
  9. / This routine by Bob McNamara.
  10.  
  11.     .globl    putline_
  12.  
  13. Scr_Seg = 0xEE00
  14. ScrPtr    = 3
  15.  
  16. putline_:
  17.     push    si
  18.     push    di
  19.     push    es
  20.     mov    ax,$Scr_Seg    /point our extra segment into screen RAM
  21.     mov    es,ax
  22.     mov    di,es:ScrPtr+1    /di <- base line address
  23.     and    di,$0x0fff
  24.     movb    al,$0xff
  25.     cld
  26.  
  27.     mov    bx,sp
  28.     mov    dx,8(bx)    /dx = row number to write
  29.     mov    si,12(bx)    /si = string to be moved
  30.     mov    bx,10(bx)    /bx = column number to start at
  31.     dec    bx        /column number starts at 1
  32.     dec    dx        /row number starts at 1 too
  33.     jz    2f
  34. 1:
  35.     mov    cx,$140
  36.     repnz scasb
  37.     mov    di,es:(di)    /di = pointer to next line
  38.     and    di,$0x0fff
  39.     dec    dx
  40.     jnz    1b
  41. 2:    
  42.     add    di,bx        /di -> offset in row
  43. 3:
  44.     cmpb    al,es:(di)
  45.     jz    4f
  46.     movsb
  47.     cmpb    al,es:(di)
  48.     jz    4f
  49.     movsb
  50.     cmpb    al,es:(di)
  51.     jz    4f
  52.     movsb
  53.     cmpb    al,es:(di)
  54.     jz    4f
  55.     movsb
  56.     cmpb    al,es:(di)
  57.     jz    4f
  58.     movsb
  59.     cmpb    al,es:(di)
  60.     jz    4f
  61.     movsb
  62.     cmpb    al,es:(di)
  63.     jz    4f
  64.     movsb
  65.     cmpb    al,es:(di)
  66.     jz    4f
  67.     movsb
  68.     jmp    3b
  69. 4:
  70.     pop    es
  71.     pop    di
  72.     pop    si
  73.     ret
  74.